import { pubRequire } from '@utils/public'
const baseUrl = '/activities'
//官方征集自评活动列表
export function getSelfList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/officials`, obj, callbBack, errBack)
}
//投票活动列表
export function getVotingList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/votes`, obj, callbBack, errBack)
}
//排行榜活动列表
export function getRankingList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/leader-boards`, obj, callbBack, errBack)
}
//活动详情-tab保存
export function saveActivities(id, obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callbBack, errBack)
}
//活动详情-触达设置-保存列表
export function saveTouchList(id, obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}/${id}/reachs`, obj, callbBack, errBack)
}
//活动详情-触达设置-删除列表
export function delTouchList(id, rid, callbBack, errBack) {
  return pubRequire(
    'delete',
    `${baseUrl}/${id}/reachs/${rid}`,
    '',
    callbBack,
    errBack
  )
}
//活动详情-触达设置-创建触达弹窗-获取详情
export function getTouchDetail(id, rid, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${id}/reachs/${rid}`,
    '',
    callbBack,
    errBack
  )
}
//活动详情-触达设置-创建触达弹窗-编辑保存
export function editTouchDetail(id, rid, obj, callbBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${id}/reachs/${rid}`,
    obj,
    callbBack,
    errBack
  )
}
//活动详情-预设用户规则-创建编号-获取详情
export function getNumberDetail(id, rid, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${id}/preestablish-crowds/${rid}`,
    '',
    callbBack,
    errBack
  )
}
//活动详情-预设用户规则-创建编号-编辑保存
export function editNum(id, rid, obj, callbBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${id}/preestablish-crowds/${rid}`,
    obj,
    callbBack,
    errBack
  )
}
//活动详情-预设用户规则-创建编号-新增保存
export function addNum(id, obj, callbBack, errBack) {
  return pubRequire(
    'post',
    `${baseUrl}/${id}/preestablish-crowds`,
    obj,
    callbBack,
    errBack
  )
}
//投票活动-预设用户规则-保存
export function saveUserSetting(id, obj, callbBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${id}/preestablish-crowds`,
    obj,
    callbBack,
    errBack
  )
}
//获取帖子活动列表
export function getActivitiesList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/options`, obj, callbBack, errBack)
}
//活动详情-奖品配置-保存列表
export function savePrize(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}/prize`, obj, callbBack, errBack)
}
//活动详情-奖品配置-编辑列表
export function editPrize(obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/prize`, obj, callbBack, errBack)
}
//导入接口
export function importUrl(prizeId, awardId) {
  return `${baseUrl}/prize/users/binding?prizeId=${prizeId}&awardId=${awardId}`
}
//下载模板接口
export function downUrl() {
  return `${baseUrl}/prize/download/dp-account`
}
